<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<h1>{{ name | cut:'s' }}</h1>
{% if age >= 18 %}
    <p>成年人</p>
{% else %}
    <p>未成年</p>
{% endif %}
<p>{{ age | add:100 }}</p>
{#单参数自定义过滤器调用使用#}
{% load my_tags %}
<p>{{ age | myadd:20 }}</p>
<p>{{ job | capfirst }}</p>
<p>{{ hobby }}</p>
<ul>
    {% for one in hobby reversed %}
        {% if forloop.first %}
            <li style="color:red">{{ forloop.counter }}{{ one }}</li>
        {% elif forloop.last %}
            <li style="color:green">{{ forloop.counter }}{{ one }}</li>
        {% else %}
            <li>{{ forloop.counter }}{{ one }}</li>
        {% endif %}

    {% endfor %}
</ul>
<p>{{ info }}</p>
<ul>
    {% for key,value in info.items %}
        <li>{{ forloop.counter }}{{ key }}:{{ value }}</li>
    {% endfor %}
</ul>
<p>{{ salary | default:1000 }}</p>
<p>{% myadd2 salary 1 1 1 %}</p>
<p>{{ time | date:'Y-m-d' }}</p>
<p>{{ info.introduction | my_replace:'开发' }}</p>
</body>
</html>